//
//  SecondViewController.m
//  Streaming
//
//  Created by 韩一博 on 15/6/27.
//  Copyright (c) 2015年 liuxun. All rights reserved.
//

#import "SecondViewController.h"

@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)dealloc
{
    [self.labelText release];
    [self.titleLabel release];
    
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.title = @"流媒体资讯";
    [self.view setBackgroundColor:[UIColor whiteColor]];
    [self addAllViews];
    
    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:31/255.0 green:115/255.0 blue:192/255.0 alpha:0.3]];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"iconfont-unie642.png"] style:UIBarButtonItemStyleDone target:self action:@selector(leftBarButtonItemAction)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
    
}
- (void)leftBarButtonItemAction
{
    [self.navigationController popViewControllerAnimated:YES];
}



#pragma mark 添加全部控件
- (void)addAllViews
{
    NSInteger x_width = self.view.frame.size.width;
    NSInteger y_height = self.view.frame.size.height;
    
    self.titleLabel = [[[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 3., 20. / 568 * y_height, 100. / 320 * x_width , 40. / 568 * y_height )] autorelease];
    _titleLabel.text = @"免责声明";
    _titleLabel.font = [UIFont boldSystemFontOfSize:20];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:_titleLabel];
    
    self.labelText = [[[UILabel alloc] initWithFrame:CGRectMake(20 , 60. / 568 * y_height  , x_width - 40, 430. / 568. * y_height )] autorelease];
    
    //    _labelText.adjustsFontSizeToFitWidth = YES;
    _labelText.numberOfLines = 0;
    _labelText.textAlignment = NSTextAlignmentLeft;
    _labelText.text = @" 1 本APP客户端用户凡以任何方式直接,间接使用本APP资料者,均被视为自愿接受本网站相关声明和用户服务协议.\n 2 APP转载的内容不代表APP手机之意见及观点,也不意味着本网赞同其观点或证实其内容的真实性.\n 3 本APP内容均由第三方提供,本APP内容仅用于欣赏和分享等非营利性用途,APP所转载的文字,图片等资料,如果侵犯了第三方的知识产权或其他权利,请通知我方开发团队做相应的修改处理.";
    
    _labelText.font = [UIFont systemFontOfSize:16];
    NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:_labelText.text];
    NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle1 setLineSpacing:8];
    [attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [_labelText.text length])];
    [_labelText setAttributedText:attributedString1];
    [_labelText sizeToFit];
    [self.view addSubview:_labelText];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
